﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Modules_Common_wucNewsToolbar : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            rtbNewsToolbar.Items[2].Attributes.Add("OnClientClick", "javascript:return ConfirmDelete();");            
        }
    }

    #region Control Properties
 
    public string FunctionName
    {
        set
        {
            lblFunctionTitle.Text = value.ToUpper();
        }
    }

    public NewsToolbarStatus NewsToolbarStatus
    {
        set
        {
            this.SetToolbarStatus(value);
        }        
    }

    public NewsEditorialPeriod NewsEditorialStatus
    {
        set
        {
            this.SetNewsEditorialPeriod(value);
        }
    }
    #endregion

    #region Event Declaration For Custom Control

    public delegate void NewsToolbarButtonClickedEventHandler(object sender, NewsToolbarButtonClickedEventArgs e);
    public event NewsToolbarButtonClickedEventHandler NewsToolbarButtonClicked;     

    #endregion

    #region Control Event Handler

    #endregion

    #region Helper Method
    
    private void SetNewsEditorialPeriod(NewsEditorialPeriod EditorialPeriod)
    {
        lblNewsEditorialPeriod.Text = EditorialPeriod.ToString().ToUpper();
    }

    private void SetToolbarStatus(NewsToolbarStatus NewsToolbarState)
    {
        // COMPOSE NEWS
        if (NewsToolbarState == NewsToolbarStatus.SINGLEROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.COMPOSE.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = true; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Enabled = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false; // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu            
            rtbNewsToolbar.Items[5].Enabled = true; //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false; //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.SINGLEROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.MULTIROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.COMPOSE.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = true; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Enabled = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false; // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Enabled = false; //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false; //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.MULTIROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.NOMAL && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.COMPOSE.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = true; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Visible = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false; // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu            
            rtbNewsToolbar.Items[5].Visible = true; //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false; //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.NOMAL.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.EDIT && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.COMPOSE.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Visible = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = true;  // quay lai
            rtbNewsToolbar.Items[4].Visible = true;  //chap nhan luu            
            rtbNewsToolbar.Items[5].Visible = true;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = true; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin   
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = true;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = false; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.EDIT.ToString();                   
        }
        if (NewsToolbarState == NewsToolbarStatus.NEW && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.COMPOSE.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Visible = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = true;  // quay lai
            rtbNewsToolbar.Items[4].Visible = true;  //chap nhan luu            
            rtbNewsToolbar.Items[5].Visible = true;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin  
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = true;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = false; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.EDIT.ToString();            
        }
        
        // VERIFY NEWS
        if (NewsToolbarState == NewsToolbarStatus.SINGLEROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.VERIFY.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Enabled = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Enabled = true;  //xem ban tin 
            rtbNewsToolbar.Items[6].Enabled = true;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = true; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin    
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.SINGLEROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.MULTIROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.VERIFY.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Enabled = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Enabled = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Enabled = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = true; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin  
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.MULTIROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.NOMAL && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.VERIFY.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Visible = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Visible = true;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = true;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = true; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin     
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.NOMAL.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.EDIT && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.VERIFY.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Visible = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = true;  // quay lai
            rtbNewsToolbar.Items[4].Visible = true; //chap nhan luu            
            rtbNewsToolbar.Items[5].Visible = true;  //xem ban tin 
            rtbNewsToolbar.Items[6].Enabled = true;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = true; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin   
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = true;//Anh tin
            rtbNewsToolbar.Items[11].Visible = true;//Tag tin
            rtbNewsToolbar.Items[12].Visible = true;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = true;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = false; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.EDIT.ToString();            
        }      
        // APPROVE NEWS
        if (NewsToolbarState == NewsToolbarStatus.SINGLEROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.APPROVE.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Enabled = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu            
            rtbNewsToolbar.Items[5].Enabled = true;  //xem ban tin 
            rtbNewsToolbar.Items[6].Enabled = true;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = true; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin      
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.SINGLEROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.MULTIROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.APPROVE.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Enabled = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu            
            rtbNewsToolbar.Items[5].Enabled = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Enabled = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = true; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin   
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.MULTIROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.NOMAL && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.APPROVE.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Visible = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu            
            rtbNewsToolbar.Items[5].Enabled = true;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = true;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = true; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin     
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.NOMAL.ToString();            
        }
        if (NewsToolbarState == NewsToolbarStatus.EDIT && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.APPROVE.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Visible = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = true;  // quay lai
            rtbNewsToolbar.Items[4].Visible = true; //chap nhan luu            
            rtbNewsToolbar.Items[5].Enabled = true;  //xem ban tin 
            rtbNewsToolbar.Items[6].Enabled = true;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = true; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin   
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = true;//Anh tin
            rtbNewsToolbar.Items[11].Visible = true;//Tag tin
            rtbNewsToolbar.Items[12].Visible = true;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = true;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = false; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.EDIT.ToString();            
        }
        // PUBLISH NEWS
        if (NewsToolbarState == NewsToolbarStatus.SINGLEROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.PUBLISH.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Enabled = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Enabled = true;  //xem ban tin 
            rtbNewsToolbar.Items[6].Enabled = true;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin   
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.SINGLEROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.MULTIROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.PUBLISH.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Enabled = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Enabled = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Enabled = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin     
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.MULTIROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.NOMAL && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.PUBLISH.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Visible = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Enabled = true;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = true;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin       
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.NOMAL.ToString();            
        }
        if (NewsToolbarState == NewsToolbarStatus.EDIT && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.PUBLISH.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Visible = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = true;  // quay lai
            rtbNewsToolbar.Items[4].Visible = true; //chap nhan luu            
            rtbNewsToolbar.Items[5].Enabled = true;  //xem ban tin 
            rtbNewsToolbar.Items[6].Enabled = true;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin      
            rtbNewsToolbar.Items[9].Visible = true; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = true;//Anh tin
            rtbNewsToolbar.Items[11].Visible = true;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = true;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = false; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.EDIT.ToString();            
        }
        // FLOW EVENT
        if (NewsToolbarState == NewsToolbarStatus.SINGLEROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.FLOWEVENT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = true; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Enabled = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false; // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu            
            rtbNewsToolbar.Items[5].Enabled = false; //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false; //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.SINGLEROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.MULTIROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.FLOWEVENT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = true; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Enabled = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false; // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Enabled = false; //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false; //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.MULTIROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.NOMAL && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.FLOWEVENT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = true; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Visible = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false; // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu            
            rtbNewsToolbar.Items[5].Visible = false; //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false; //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.NOMAL.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.EDIT && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.FLOWEVENT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Visible = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = true;  // quay lai
            rtbNewsToolbar.Items[4].Visible = true;  //chap nhan luu            
            rtbNewsToolbar.Items[5].Visible = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin   
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = true;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = false; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.EDIT.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.NEW && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.FLOWEVENT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Visible = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = true;  // quay lai
            rtbNewsToolbar.Items[4].Visible = true;  //chap nhan luu            
            rtbNewsToolbar.Items[5].Visible = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin  
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = true;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = false; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.EDIT.ToString();
        }
        // PUBLISH NEWS COMMENT
        if (NewsToolbarState == NewsToolbarStatus.SINGLEROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.PUBLISHCOMMENT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Enabled = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Visible = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin   
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.SINGLEROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.MULTIROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.PUBLISHCOMMENT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Enabled = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Visible = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin     
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.MULTIROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.NOMAL && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.PUBLISHCOMMENT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Visible = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Visible = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin       
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.NOMAL.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.EDIT && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.PUBLISHCOMMENT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Visible = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = true;  // quay lai
            rtbNewsToolbar.Items[4].Visible = true; //chap nhan luu            
            rtbNewsToolbar.Items[5].Visible = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin      
            rtbNewsToolbar.Items[9].Visible = true; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = false; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.EDIT.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.NOMAL && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.REPORT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Visible = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu            
            rtbNewsToolbar.Items[5].Visible = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = false; //xuat ban tin      
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = true;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.NOMAL.ToString();
        }
        // PUBLISH ADVERT
        if (NewsToolbarState == NewsToolbarStatus.SINGLEROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.ADVERT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = true; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Enabled = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Enabled = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Enabled = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin   
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.SINGLEROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.MULTIROWSELECTED && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.ADVERT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Enabled = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Enabled = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Enabled = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Enabled = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin     
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.MULTIROWSELECTED.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.NOMAL && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.ADVERT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = true; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Visible = true; //chinh sua
            rtbNewsToolbar.Items[3].Visible = false;  // quay lai
            rtbNewsToolbar.Items[4].Visible = false; //chap nhan luu           
            rtbNewsToolbar.Items[5].Visible = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin       
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = false;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = true; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.NOMAL.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.EDIT && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.ADVERT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = true; //xoa
            rtbNewsToolbar.Items[2].Visible = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = true;  // quay lai
            rtbNewsToolbar.Items[4].Visible = true; //chap nhan luu            
            rtbNewsToolbar.Items[5].Visible = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin      
            rtbNewsToolbar.Items[9].Visible = true; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = true;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = false; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.EDIT.ToString();
        }
        if (NewsToolbarState == NewsToolbarStatus.NEW && lblNewsEditorialPeriod.Text == NewsEditorialPeriod.ADVERT.ToString().ToUpper())
        {
            rtbNewsToolbar.Items[0].Visible = false; //Tao moi
            rtbNewsToolbar.Items[1].Visible = false; //xoa
            rtbNewsToolbar.Items[2].Visible = false; //chinh sua
            rtbNewsToolbar.Items[3].Visible = true;  // quay lai
            rtbNewsToolbar.Items[4].Visible = true;  //chap nhan luu            
            rtbNewsToolbar.Items[5].Visible = false;  //xem ban tin 
            rtbNewsToolbar.Items[6].Visible = false;  //gui tra cap duoi
            rtbNewsToolbar.Items[7].Visible = false; //duyet len tren
            rtbNewsToolbar.Items[8].Visible = true; //xuat ban tin  
            rtbNewsToolbar.Items[9].Visible = false; //Go tin xuong
            rtbNewsToolbar.Items[10].Visible = true;//Anh tin
            rtbNewsToolbar.Items[11].Visible = false;//Tag tin
            rtbNewsToolbar.Items[12].Visible = false;//Comment
            rtbNewsToolbar.Items[13].Visible = false;//FlowEvent
            rtbNewsToolbar.Items[14].Visible = false;//News Relate
            rtbNewsToolbar.Items[15].Visible = false;//Print Report
            rtbNewsToolbar.Items[16].Visible = true; //Load lai
            rtbNewsToolbar.Items[17].Visible = false; //Loc
            lblNewsToolbarStatus.Text = NewsToolbarStatus.EDIT.ToString();
        }
    }

    #endregion

    #region Raise Event  
    protected void rtbNewsToolbar_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
    {
        NewsToolbarButtonClickedEventArgs objEventArg = null;
        switch (e.Item.Text.ToLower())
        {
            case "tạo mới":
                objEventArg = new NewsToolbarButtonClickedEventArgs("NEWBUTTON", NewsToolbarButton.NEWBUTTON);
                break;
            case "xóa":
                objEventArg = new NewsToolbarButtonClickedEventArgs("DELBUTTON", NewsToolbarButton.DELBUTTON);
                break;
            case "chỉnh sửa":
                objEventArg = new NewsToolbarButtonClickedEventArgs("EDITBUTTON", NewsToolbarButton.EDITBUTTON);
                break;           
            case "quay lại":
                objEventArg = new NewsToolbarButtonClickedEventArgs("UNDOBUTTON", NewsToolbarButton.UNDOBUTTON);
                break;
            case "lưu":
                objEventArg = new NewsToolbarButtonClickedEventArgs("SAVEBUTTON", NewsToolbarButton.SAVEBUTTON);
                break;            
            case "xem":
                objEventArg = new NewsToolbarButtonClickedEventArgs("PREVIEWBUTTON", NewsToolbarButton.PREVIEWBUTTON);
                break;
            case "trả bài":
                objEventArg = new NewsToolbarButtonClickedEventArgs("RETURNBUTTON", NewsToolbarButton.RETURNBUTTON);
                break;
            case "gửi bài":
                objEventArg = new NewsToolbarButtonClickedEventArgs("SUBMITBUTTON", NewsToolbarButton.SUBMITBUTTON);
                break;
            case "lên trang":
                objEventArg = new NewsToolbarButtonClickedEventArgs("PUBLISHBUTTON", NewsToolbarButton.PUBLISHBUTTON);
                break;
            case "gỡ tin":
                objEventArg = new NewsToolbarButtonClickedEventArgs("UNPUBLISHBUTTON", NewsToolbarButton.UNPUBLISHBUTTON);
                break;
            case "ảnh tin":
                objEventArg = new NewsToolbarButtonClickedEventArgs("IMAGEBUTTON", NewsToolbarButton.IMAGEBUTTON);
                break;
            case "tag tin":
                objEventArg = new NewsToolbarButtonClickedEventArgs("TAGBUTTON", NewsToolbarButton.TAGBUTTON);
                break;
            case "phản hồi":
                objEventArg = new NewsToolbarButtonClickedEventArgs("COMMENTBUTTON", NewsToolbarButton.COMMENTBUTTON);
                break;
            case "sự kiện":
                objEventArg = new NewsToolbarButtonClickedEventArgs("FLOWEVENTBUTTON", NewsToolbarButton.FLOWEVENTBUTTON);
                break;
            case "liên quan":
                objEventArg = new NewsToolbarButtonClickedEventArgs("RELATEBUTTON", NewsToolbarButton.RELATEBUTTON);
                break;
            case "in":
                objEventArg = new NewsToolbarButtonClickedEventArgs("PRINTREPORT", NewsToolbarButton.PRINTREPORT);
                break;
            case "load lại":
                objEventArg = new NewsToolbarButtonClickedEventArgs("REFRESHBUTTON", NewsToolbarButton.REFRESHBUTTON);
                break;
            case "lọc":
                objEventArg = new NewsToolbarButtonClickedEventArgs("FILTERBUTTON", NewsToolbarButton.FILTERBUTTON);
                break;
        }
        NewsToolbarButtonClicked(this, objEventArg);
    }

    protected virtual void OnNewsToolbarButtonClicked(NewsToolbarButtonClickedEventArgs e)
    {
        if (NewsToolbarButtonClicked != null) NewsToolbarButtonClicked(this, e);
    }
    #endregion   
}
